﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DataLayer.Database;

namespace DataLayer.Class
{
    public class Masa : IOperable
    {
        MasaDB masaDB = new MasaDB();
        int masaID;
        public bool rezerveMi = false;
        public int MasaID
        {
            get { return masaID; }
            set { masaID = value; }
        }
        MasaTipi masaTipi;

        public MasaTipi MasaTipi
        {
            get { return masaTipi; }
            set { masaTipi = value; }
        }
        int kapasite;

        public int Kapasite
        {
            get { return kapasite; }
            set { kapasite = value; }
        }


        public Masa(int masaID, int kapasite, bool rezerveMi, MasaTipi masaTipi)
        {
            // TODO: Complete member initialization
            this.masaID = masaID;
            this.kapasite = kapasite;
            this.rezerveMi = rezerveMi;
            this.masaTipi = masaTipi;
        }

        public Masa()
        {
            // TODO: Complete member initialization
            masaTipi = new MasaTipi();
        }


        public Masa(int kapasite, MasaTipi masaTipi)
        {
            // TODO: Complete member initialization
            this.kapasite = kapasite;
            this.masaTipi = masaTipi;
        }

        public bool RezerveMi
        {
            get { return rezerveMi; }
            set { rezerveMi = value; }
        }

        public void ekle()
        {
            masaDB.masaEkle(this);
        }

        public void sil()
        {
            masaDB.masaSil(this.MasaID);
        }

        public void guncelle()
        {
            masaDB.masaDuzenle(this);
        }

        public void rezerveEt(Rezervasyon rez)
        {
            rez.Masa = this;
        }
    }
}
